package com.lzk.controller;

import java.util.List;

import com.jfinal.core.Controller;
import com.jfinal.core.Path;
import com.jfinal.kit.Ret;
import com.lzk.model.ZcData;
import com.lzk.service.DataService;
import com.lzk.service.impl.DataServiceImpl;

@Path("/data")
public class DataController extends Controller{
	DataService ds = new DataServiceImpl();
	
	public void getDataByKey() {
		String key = getPara("key"); 
		List<ZcData> list = ds.getDataByKey(key);
		if(list==null || list.size() == 0) {
			renderJson(Ret.fail("关键字不存在！请检查！"));
		}else {
			renderJson(Ret.ok("data",list));
		}
	}
}
